﻿using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace  Frame.Core.Models
{
    [Table(DisableSyncStructure = true)]
    public class PagingInfoViewModel<T>
    {
        /// <summary>
        /// 总记录数
        /// </summary>
        public long Count { get; set; }

        /// <summary>
        /// 第几页
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 每页条数
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 分页主键
        /// </summary>
        public Expression<Func<T, int>> PageKey{ get; set; }
        /// <summary>
        /// 排序字段
        /// </summary>
        public string SortField { get; set; }

        /// <summary>
        /// 排序方式
        /// </summary>
        public bool Descending { get; set; }

        /// <summary>
        /// 数据
        /// </summary>
        public List<T> List { get; set; }

    }
}